<?php

//$v_fuseaction_back = $_REQUEST['fuseaction'];
//$v_url_send_question = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION_FOR_SENDING&fuseaction_back=".$v_fuseaction_back;
$v_url_send_question = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION_FOR_SENDING&cate_type=".$v_cate_type;

if ($v_total_qa>0){
	$v_str_num_of_qa = "(".$v_total_qa.")";
}else{
	$v_str_num_of_qa = "";
}

$v_current_style_name = "odd_row";
$v_next_style_name="";
?>
<!--bang chua tieu de cua form-->
<form action="index.php" method="post" name="frm_dsp_all_qa_by_cate">
<table width="100%" cellpadding="0" cellspacing="0">
<input type="hidden" name="fuseaction" value="">
<input type="hidden" name="hdn_page" value="<?php echo $v_page?>">
<input type="hidden" name="hdn_cate_id" value="<?php echo $v_cate_id?>">
<input type="hidden" name="cate_type" value="<?php echo $v_cate_type;?>">
<tr class="page_title">
		<td colspan="2"><?php echo $v_title; ?></td>
	</tr>
	<tr> <td></td>
		<td class="send_qa_link" >
			<a href="<?php echo $v_url_send_question;?>"><?php echo $v_send_qa;?></a>
			<img src="<?php echo $_ISA_IMAGE_URL_PATH?>send_qa.gif">
		</td>
	</tr>
	<tr style="display:<?php echo $v_dsp_list_cate;?> ">
		<td class="normal_label"><?php echo CONST_CATEGORY_LABEL;?></td>
		<td class="normal_label" >
			<select class= "normal_selectbox" style="width:75%"  name = "cbo_cate" onChange="cbo_cate_oncchange()" optional = "<?php echo ""; ?>">
					<? echo _generate_select_option($arr_all_cate,"0","0","2", $v_cate_id);?>	
			</select>
		</td>
 	</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr><td height="5pt"></td></tr>
	<tr class="agency_link"> 
		<td align="left"><?php echo $v_cate_name; ?><small class="number_label"><?php echo $v_str_num_of_qa;?></small>
		</td>
	</tr>
	<?php
	if ($v_qa_count >0){
		$row_index = 0;
		while($row_index < $v_qa_count){
			$v_qa_id = $arr_result[$row_index]['PK_QA'];			
			$v_qa_questioner_name = $arr_result[$row_index]['C_QUESTIONER_NAME'];
			$v_qa_question_title = $arr_result[$row_index]['C_QUESTION_TITLE'];
			$v_question_date = _yyyymmdd_to_ddmmyyyy($arr_result[$row_index]['C_QUESTION_DATE']);

			$v_qa_url = "index.php?fuseaction=DISPLAY_SINGLE_QA_QUESTION&qa_id=".$v_qa_id."&cate_type=".$v_cate_type;
			
			$v_str_questioner_information = "(";
			$v_str_questioner_information = $v_str_questioner_information.$v_qa_questioner_name;
			$v_str_questioner_information = $v_str_questioner_information.", ng&#224;y : ".$v_question_date.")";			
			
			?>
			<tr class="<?php echo $v_current_style_name ?>">
				<td align="left">
					<img src="<?php echo $_ISA_IMAGE_URL_PATH?>nut_before_article.gif" >
					<a class="cate_on_list_page" href="<?php echo $v_qa_url; ?>"><?php echo $v_qa_question_title; ?>&nbsp;</a><small class="number_label"><?php echo $v_str_questioner_information;?></small>
				</td>
			</tr><?php
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			} 
			$row_index++ ;  
		}	
	echo _add_empty_row($v_qa_count,16,$v_current_style_name,$v_next_style_name,2);
	}else{ ?>
		<tr>
			<td class="normal_label"><?php echo $v_qa_empty;?></td>
		</tr><?php
	}
	?>
	
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<col width="5%"><col width="95%">
	<tr>
		<td align="right" class="normal_link"><?
			if ($v_total_qa >0){
				echo PageBreak($v_total_qa,$v_page,3,CONST_NUMBER_OF_QA_PER_PAGE);	
				//echo PageBreak($v_total_qa,$v_page,3,$v_limit);					
			}?>
		</td>
	</tr>
</table>
</form>
	
